<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <h:body>

        <ui:composition template="../communityTemplate.xhtml">
            <ui:define name="content">
                
                <h:form>
                    <h:panelGrid columns="2">
                        <h:outputText value="Add interest: "/>
                        <h:inputText id="interestBox" value="#{interestBean.newInterest}">  
                            <f:validateLength minimum="3" maximum="44"/>
                        </h:inputText>
                        <p:message id="msg1" for="interestBox" display="text" showDetail="FALSE" showSummary="TRUE"/>
                        <h:commandButton value="Add" action="#{interestBean.addInterest}"/>
                    </h:panelGrid>
                </h:form>
                
                <h:form>
                    <p:dataList value="#{interestBean.interests}" var="interest">
                        #{interest.name}, 
                    </p:dataList>
                </h:form>
                
            </ui:define>
        </ui:composition>
    </h:body>
</html>

